package com.app.model;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.sql.Timestamp;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("lm_electronic")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ElectronicModel {
    @ExcelIgnore
    @TableId(type = IdType.AUTO)
    private Integer id;
    //@ExcelProperty(index = 0)
    private Integer number;  //序号
    @ExcelProperty(index = 0)
    private String name;//设备名称
    @ExcelIgnore
    private Integer brand;//品牌ID
    @ExcelIgnore
    private Integer device;//设备型号ID
    @ExcelIgnore
    private Integer personId;//所属人ID，person表
    @ExcelIgnore
    private Integer deviceType;//设备类型ID  1手机2平板3电脑4手表 categoryPhone
    @ExcelProperty(index = 5)
    private String serialization;//机身串码  卡1
    @ExcelProperty(index = 6)
    private String OtherSerialization;//机身串码 卡2
    @ExcelProperty(index = 7)
    private String macAddress;//mac地址
    @ExcelProperty(index = 8)
    private String bluetoothAddress;//蓝牙通信地址
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") //后端注解格式化日期
    @ExcelProperty(index = 9)
    private String activationTime;//启用时间
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") //后端注解格式化日期
    @ExcelProperty(index = 10)
    private String downTime;//停用时间
    @ExcelProperty(index = 11)
    private String mobile;//手机号 卡1
    @ExcelProperty(index = 12)
    private String otherMobile;//手机号 卡2
    @ExcelProperty(index = 13)
    private String idCard;//身份证号

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") //后端注解格式化日期
    private Timestamp createTime;
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") //后端注解格式化日期
    private Timestamp updateTime;


    @TableField(exist = false)
    @ExcelProperty(index = 1)
    private String brandText;// 品牌名称字段
    @TableField(exist = false)
    @ExcelProperty(index = 2)
    private String deviceText;// 设备型号字段
    @TableField(exist = false)
    @ExcelProperty(index = 3)
    private String personName;// 所属人名字字段
    @TableField(exist = false)
    @ExcelProperty(index = 4)
    private String deviceTypeText;// 设备分类字段 1手机2平板3电脑4手表

    @TableField(exist = false)
    private Integer count;

}
